﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title></title>
    <style type="text/css">
        body
        {
            font-size: 12px;
            width:58mm;
        }
        table
        {
            font-size: 12px;
        }
        .styleTop
        {
            height: 29px;
            text-align: center;
        }
        .styleTopTd
        {
            height: 25px;
        }
        .styleBottom
        {
            width: 100%;
        }
     
    </style>
</head>
<body>
    <table border="0" width="100%">
        <tr>
            <td colspan="2" class="styleTop">
                零售小票
            </td>
        </tr>
        <tr>
            <td class="styleTopTd">
                机器号:[PosNO]
            </td>
            <td class="styleTopTd">
                收银员:[_UserSName]
            </td>
        </tr>
        <tr>
            <td class="styleTopTd"  colspan="2">
                流水号:[OrderNO]
            </td>
        </tr>
        <tr>
            <td class="styleTopTd" colspan="2">
                日期:[OrderDateTime]
            </td>
        </tr>
    </table>

    <hr />
    <div id="detail">
        <script language="javascript" type="text/javascript">
            [productSList]
        </script>
    </div>
    <table class="styleBottom">
        <tr>
            <td>
                商品总数:
            </td>
            <td id="SumQuantity" style="text-align: center">
            </td>
            <td>
                合计金额:
            </td>
            <td id="SumMoney" style="text-align: right">
            </td>
        </tr>
    </table>
    <hr />
    <div style="width: 100%; text-align: center;">
        欢迎再次惠顾<br /> -- 华皓商业管理系统 -- </div>
    <script language="javascript" type="text/javascript">
        var sumMoney = 0;
        var sumQuantity = 0;
        var str = "<table class='detailClass' width='100%' border='0'><tr><td>商品名称</td><td>单位</td><td>单价</td><td>数量</td></tr>";
        for (a = 0; a < productSList.length; a++) {
            var b = productSList[a];
            str += "<tr>";
            str += "<td>" + b["Name"] + "</td>";
            str += "<td>" + b["_UnitName"] + "</td>";
            str += "<td>" + b["_TempPrice"] + "</td>";
            str += "<td>" + b["_TempQuantity"] + "</td>";
            str += "</tr>";
            sumMoney += b["_TempPrice"] * b["_TempQuantity"];
            sumQuantity += b["_TempQuantity"]*1;
        }
        str += "</table>";
        detail.innerHTML = str;
        document.getElementById("SumQuantity").innerHTML = sumQuantity;
        document.getElementById("SumMoney").innerHTML = sumMoney;
    </script>
</body>
</html>
